//
//  MusicDetailViewController.m
//  FNer
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 刘志强. All rights reserved.
//


#import "MusicDetailTableView.h"
#import "MusicErchDetailModel.h"
#import "MusicInfo.h"
@interface MusicDetailTableView ()

@property (nonatomic, strong)UIImageView *imageV;
@property (nonatomic, strong)UILabel *namelabel;



@end


@implementation MusicDetailTableView


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creat];
    }
    return self;
}

- (void)creat
{
    self.imageV = [UIImageView new];
    [self addSubview:self.imageV];
    [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).with.offset(5);
        make.top.equalTo(self).with.offset(0);
        make.height.equalTo(self);
        make.width.equalTo(@120);
    }];
    

    
    self.namelabel = [UILabel new];
    
    [self addSubview:self.namelabel];
    [self.namelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.imageV.mas_right).with.offset(5);
        make.top.equalTo(self).with.offset(10);
        make.height.equalTo(@50);
        make.width.equalTo(@220);
        
       
    }];
   

}

- (void)setModel:(MusicErchDetailModel *)model
{
    self.namelabel.text = model.name;
    self.namelabel.numberOfLines = 0;
    NSURL *url = [NSURL URLWithString:model.pic_200];
    [self.imageV sd_setImageWithURL:url placeholderImage:nil];
}


- (void)setModelinfo:(MusicInfo *)modelinfo
{
    self.namelabel.text = modelinfo.musicName;
    self.namelabel.numberOfLines = 0;
    NSURL *url = [NSURL URLWithString:modelinfo.musicImage];
    [self.imageV sd_setImageWithURL:url placeholderImage:nil];

}

@end
